<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            list-style: none;
        }

        a {
            text-decoration: none;
        }

        body {
            font-family: Arial;
            background: #f1f1f1;
        }

        .bodyDiv {
            width: 80%;
            margin: auto;
        }

        h2 {
            font-size: 1.5rem;
            text-align: center;
            color: rgb(68, 123, 103);
            padding: 10px;
            margin-bottom: 20px;
        }

        ul {
            width: 100%;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            margin: auto;
            /* align-items: space-between; */
        }

        li {
            width: 240px;
            list-style: none;
            margin-bottom: 20px;
            border: 1px solid rgb(68, 123, 103);
        }

        img {
            width: 100%;
        }

        .main_div {
            width: 100%;
            height: 20rem;
            position: relative;
            margin-bottom: 30px;
            background-image: url(../image/public/壁纸\ \(1\).jpg);
            background-size: 100%;
            background-repeat: no-repeat;
            background-position: 0px -0.6675rem;
        }

        .main_title {
            background-image: url(../image/public/title.jpg);
            background-size: 100%;
            position: absolute;
            width: 60px;
            height: 60px;
            border-radius: 50%;
            top: 50%;
            /* 将元素顶部移动到父元素高度的中点 */
            left: 50%;
            /* 可选：如果你也想水平居中 */
            transform: translate(-50%, -50%);
            /* 将元素移动到其中心点与父元素的中点对齐 */
        }

        .main_title_span {
            width: 100%;
            display: inline-block;
            position: absolute;
            bottom: -.89rem;
            text-align: center;
            font-size: .9rem;
            color: rgb(68, 123, 103);
            font-weight: bolder;
        }

        .backClass {
            padding: 10px;
            background-color: #4CAF50;
            border-radius: 20%;
            margin: 1.333333vw;
            position: fixed;
            z-index: 1;
        }

        .backClass a {
            color: white;
        }
    </style>
</head>

<body>
    <div class="bodyDiv">
        <div class="backClass"><a href="./index.html">返回</a></div>
        <!-- 头部背景+头像+登录+注册 -->
        <div class="main_div">
            <div class="main_title">
                <span class="main_title_span">王大头</span>
            </div>

        </div>
        <h2>摄影作品</h2>
        <div style="width: 100%;margin-top: 10px;">
            <ul id="getul">

            </ul>
        </div>

    </div>
</body>

</html>
<script>

    let Div = document.getElementById('getul');


    for (var i = 1; i < 30; i++) {
        var lis = document.createElement('li')
        var img = document.createElement('img');
        img.src = `../image/img/1 (${i}).jpg`;
        lis.appendChild(img);
        Div.appendChild(lis);
    }
</script>